<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
           targetNamespace="urn:schemas-microsoft-com:asm.v1" 
           xmlns="urn:schemas-microsoft-com:asm.v1" 
           elementFormDefault="qualified">

	<xs:annotation>
		<xs:documentation>
			Copyright (C) 2005 Matthew Ward
		
			This program is free software; you can redistribute it and/or modify
			it under the terms of the GNU General Public License as published by
			the Free Software Foundation; either version 2 of the License, or
			(at your option) any later version.

			This program is distributed in the hope that it will be useful,
			but WITHOUT ANY WARRANTY; without even the implied warranty of
			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
			GNU General Public License for more details.
			
			You should have received a copy of the GNU General Public License
			along with this program; if not, write to the Free Software
			Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
		</xs:documentation>
	</xs:annotation>

	<xs:element name="assembly">
		<xs:complexType>
			<xs:choice minOccurs="0" maxOccurs="unbounded">
				<xs:element name="description" minOccurs="0" maxOccurs="1"/>
				<xs:element name="noInherit" minOccurs="0" maxOccurs="1"/>
				<xs:element name="noInheritable" minOccurs="0" maxOccurs="1"/>
				<xs:element name="assemblyIdentity" type="assemblyIdentity" minOccurs="1" maxOccurs="1"/>
				<xs:choice minOccurs="0" maxOccurs="unbounded">
					<xs:element name="clrClass" type="clrClass" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="comInterfaceExternalProxyStub" type="comInterfaceExternalProxyStub" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="clrSurrogate" type="clrSurrogate" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="dependency" type="dependency" minOccurs="0" maxOccurs="unbounded"/>				
					<xs:element name="file" type="file" minOccurs="0" maxOccurs="unbounded"/>
				</xs:choice>
			</xs:choice>
			<xs:attribute name="manifestVersion" type="xs:string" default="1.0"/>
		</xs:complexType>
	</xs:element>

	<xs:complexType name="assemblyIdentity">
		<xs:attribute name="type" type="xs:string" use="required"/>
		<xs:attribute name="name" type="xs:string" use="required"/>
		<xs:attribute name="language" type="xs:string"/>
		<xs:attribute name="processorArchitecture" type="xs:string"/>
		<xs:attribute name="version" type="xs:string" use="required"/>
		<xs:attribute name="publicKeyToken" type="xs:string"/>
	</xs:complexType>

	<xs:complexType name="dependency">
		<xs:sequence>
			<xs:element name="dependentAssembly" type="dependentAssembly"  minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="optional" type="xs:string"/>
	</xs:complexType>

	<xs:complexType name="dependentAssembly">
		<xs:sequence>
			<xs:element name="assemblyIdentity" type="assemblyIdentity" minOccurs="1" maxOccurs="1"/>
			<xs:element name="bindingRedirect" type="bindingRedirect" minOccurs="0" maxOccurs="1"/>
		</xs:sequence>
	</xs:complexType>
		
	<xs:complexType name="file">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:element name="comClass" minOccurs="0" maxOccurs="unbounded">
				<xs:complexType>
					<xs:sequence minOccurs="0" maxOccurs="unbounded">
						<xs:element name="progid" minOccurs="0" maxOccurs="unbounded"/>
					</xs:sequence>
					<xs:attribute name="clsid" type="xs:string" use="required"/>
					<xs:attribute name="threadingmodel" type="xs:string" use="required"/>
					<xs:attribute name="progid" type="xs:string"/>
					<xs:attribute name="tlbid" type="xs:string"/>
					<xs:attribute name="description" type="xs:string"/>
				</xs:complexType>
			</xs:element>
			<xs:element name="comInterfaceProxyStub" minOccurs="0" maxOccurs="unbounded">
				<xs:complexType>
					<xs:attribute name="iid" type="xs:string" use="required"/>
					<xs:attribute name="name" type="xs:string" use="required"/>
					<xs:attribute name="numMethods" type="xs:string"/>
					<xs:attribute name="tlbid" type="xs:string"/>
					<xs:attribute name="proxyStubClsid32" type="xs:string"/>
					<xs:attribute name="baseInterface" type="xs:string"/>
				</xs:complexType>
			</xs:element>		
			<xs:element name="typelib" minOccurs="0" maxOccurs="unbounded">
				<xs:complexType>
					<xs:attribute name="version" type="xs:string" use="required"/>
					<xs:attribute name="helpdir" type="xs:string" use="required"/>
					<xs:attribute name="resourceid" type="xs:string"/>
					<xs:attribute name="tlbid" type="xs:string" use="required"/>
					<xs:attribute name="flags" type="xs:string"/>
				</xs:complexType>
			</xs:element>		
			<xs:element name="windowClass" minOccurs="0" maxOccurs="unbounded">
				<xs:complexType mixed="true">
					<xs:attribute name="versioned" type="xs:string"/>
				</xs:complexType>
			</xs:element>			
		</xs:choice>
		<xs:attribute name="name" type="xs:string"/>
		<xs:attribute name="hashalg" type="xs:string"/>
		<xs:attribute name="hash" type="xs:string"/>
	</xs:complexType>

	<xs:complexType name="clrClass">
		<xs:sequence minOccurs="0" maxOccurs="unbounded">
			<xs:element name="progid" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="clsid" type="xs:string" use="required"/>
		<xs:attribute name="name" type="xs:string" use="required"/>
		<xs:attribute name="progid" type="xs:string"/>
		<xs:attribute name="description" type="xs:string"/>
		<xs:attribute name="threadingModel" type="xs:string" default="Both"/>
		<xs:attribute name="runtimeVersion" type="xs:string"/>
		<xs:attribute name="tlbid" type="xs:string"/>
	</xs:complexType>

	<xs:complexType name="clrSurrogate">
		<xs:attribute name="clsid" type="xs:string" use="required"/>
		<xs:attribute name="name" type="xs:string" use="required"/>
		<xs:attribute name="runtimeVersion" type="xs:string"/>
	</xs:complexType>
	
	<xs:complexType name="comInterfaceExternalProxyStub">
		<xs:attribute name="iid" type="xs:string" use="required"/>
		<xs:attribute name="name" type="xs:string" use="required"/>
		<xs:attribute name="tlbid" type="xs:string"/>
		<xs:attribute name="numMethods" type="xs:string"/>
		<xs:attribute name="proxyStubClsid32" type="xs:string"/>
		<xs:attribute name="baseInterface" type="xs:string"/>
	</xs:complexType>
	
	<xs:complexType name="bindingRedirect">
		<xs:attribute name="oldVersion" type="xs:string" use="required"/>
		<xs:attribute name="newVersion" type="xs:string" use="required"/>
	</xs:complexType>
	
	<!-- Cheat - This and the following elements are added so app.config autocompletion 
         will work if the user specifies the urn:schemas-microsoft-com:asm.v1 namespace 
         in an app.config file. -->
	<xs:element name="assemblyBinding">
		<xs:complexType>
			<xs:choice>
				<xs:element name="dependentAssembly" type="dependentAssemblyType" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element name="probing" type="probing" minOccurs="0" maxOccurs="1"/>
				<xs:element name="publisherPolicy" type="publisherPolicy" minOccurs="0" maxOccurs="1"/>						
				<xs:element name="qualifyAssembly" type="qualifyAssembly" minOccurs="0" maxOccurs="1"/>						
			</xs:choice>
			<xs:attribute name="appliesTo" type="xs:string" use="required"/>
		</xs:complexType>				
	</xs:element>			

	<xs:complexType name="dependentAssemblyType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:element name="assemblyIdentity" minOccurs="1" maxOccurs="1">
				<xs:complexType>
					<xs:attribute name="name" type="xs:string" use="required"/>				
					<xs:attribute name="publicKeyToken" type="xs:string"/>				
					<xs:attribute name="culture" type="xs:string"/>				
				</xs:complexType>
			</xs:element>
			<xs:element name="codeBase" minOccurs="0" maxOccurs="1">
				<xs:complexType>
					<xs:attribute name="version" type="xs:string" use="required"/>				
					<xs:attribute name="href" type="xs:anyURI" use="required"/>				
				</xs:complexType>
			</xs:element>
			<xs:element name="bindingRedirect" minOccurs="0" maxOccurs="unbounded">
				<xs:complexType>
					<xs:attribute name="oldVersion" type="xs:string" use="required"/>				
					<xs:attribute name="newVersion" type="xs:string" use="required"/>				
				</xs:complexType>
			</xs:element>
			<xs:element name="publisherPolicy" type="publisherPolicy" minOccurs="0" maxOccurs="1"/>		
		</xs:choice>
	</xs:complexType>

	<xs:complexType name="probing">
		<xs:attribute name="privatePath" type="xs:string" use="required"/>
	</xs:complexType>

	<xs:complexType name="publisherPolicy">
		<xs:attribute name="apply" type="yesNoEnum" use="required"/>
	</xs:complexType>

	<xs:complexType name="qualifyAssembly">
		<xs:attribute name="partialName" type="xs:string" use="required"/>
		<xs:attribute name="fullName" type="xs:string" use="required"/>
	</xs:complexType>

	<xs:simpleType name="yesNoEnum">
		<xs:restriction base="xs:string">
			<xs:enumeration value="yes"/>							
			<xs:enumeration value="no"/>
		</xs:restriction>
	</xs:simpleType>

</xs:schema>
